/* Data analysis with merged database */

clear
drop _all
graph drop _all

use "PELA_LAPOP.dta"

/* Descriptive Statistics */

tab country

tab database

tab parties

sum publicfirms democracy democracy_cont samesex reduceinequality

*******************************************
*******************************************
/* Component 1: Private Property */
*******************************************
*******************************************

/* Elites */

** Paraguay
ttest publicfirms if country == 1 & parties < 3 & database == 1, by(parties)

** Honduras
ttest publicfirms if country == 2 & parties < 3 & database == 1, by(parties)

** Nicaragua
ttest publicfirms if country == 3 & database == 1, by(parties)


/* Voters */

** Paraguay
ttest publicfirms if country == 1 & parties < 3 & database == 2, by(parties)

** Honduras
ttest publicfirms if country == 2 & parties < 3 & database == 2, by(parties)

** Nicaragua
ttest publicfirms if country == 3 & parties < 4 & database == 2, by(parties)


*******************************************
*******************************************
/* Component 2: Liberal Democracy */
*******************************************
*******************************************

/* Elites */

** Paraguay
ttest democracy if country == 1 & parties < 3 & database == 1, by(parties)

** Honduras
ttest democracy if country == 2 & parties < 3 & database == 1, by(parties)

** Nicaragua
ttest democracy if country == 3 & database == 1, by(parties)


/* Voters */

tab democracy_cont

gen democracy_cont_bin = 1
replace democracy_cont_bin = 0 if democracy_cont != 1
replace democracy_cont_bin = . if democracy_cont == .

** Paraguay
ttest democracy_cont_bin if country == 1 & parties < 3 & database == 2, by(parties)

** Honduras
ttest democracy_cont_bin if country == 2 & parties < 3 & database == 2, by(parties)

** Nicaragua
ttest democracy_cont_bin if country == 3 & parties < 4 & database == 2, by(parties)



*******************************************
*******************************************
/* Component 3: Non-Conformism */
*******************************************
*******************************************

/* Elites */

** Paraguay
ttest samesex if country == 1 & parties < 3 & database == 1, by(parties)

** Honduras
ttest samesex if country == 2 & parties < 3 & database == 1, by(parties)

** Nicaragua
ttest samesex if country == 3 & database == 1, by(parties)


/* Voters */

** Paraguay
ttest samesex if country == 1 & parties < 3 & database == 2, by(parties)

** Honduras
ttest samesex if country == 2 & parties < 3 & database == 2, by(parties)

** Nicaragua
ttest samesex if country == 3 & parties < 4 & database == 2, by(parties)



*******************************************
*******************************************
/* Component 4: Social Justice */
*******************************************
*******************************************

/* Elites */

** Paraguay
ttest reduceinequality if country == 1 & parties < 3 & database == 1, by(parties)

** Honduras
ttest reduceinequality if country == 2 & parties < 3 & database == 1, by(parties)

** Nicaragua
ttest reduceinequality if country == 3 & database == 1, by(parties)


/* Voters */

** Paraguay
ttest reduceinequality if country == 1 & parties < 3 & database == 2, by(parties)

** Honduras
ttest reduceinequality if country == 2 & parties < 3 & database == 2, by(parties)

** Nicaragua
ttest reduceinequality if country == 3 & parties < 4 & database == 2, by(parties)
